<template>
  <div id="app">
    <router-view />
  </div>
</template>


<script>
export default {
  name: "App",
  // 确保当用户刷新之后或直接通过链接访问页面时，标题栏会显示当前页的标题
  watch: {
    $route(to, from) {

      console.log("to")
      console.log(to)

      if (to.path != '/login') {
        let obj = {
          name: to.name,
          title: to.meta.title
        }

        this.$store.commit("addTab", obj)
      }

    }
  }
}

</script>

<style>
#app {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* text-align: center; */
  color: #2c3e50;
  margin-top: 60px;
}
</style>
